/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package be.hogent.iii.project.guigameroom;

import be.hogent.iii.project.guigameroom.GameRoomGui;
import java.awt.Dimension;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
import javax.swing.JFrame;

/**
 *
 * @author jef donders
 */
public class GameRoomGuiFrame extends JFrame {
    
    public GameRoomGuiFrame(){
        Dimension size = new Dimension(1000, 650);
        GameRoomGui gui = new GameRoomGui(size);
        this.add(gui);
        pack();
        setContentPane(gui);
        setVisible(true);
        this.addComponentListener(new ComponentAdapter(){
            public void componentResized(ComponentEvent e)
                {
                    //GameRoomGuiFrame tmp = (GameRoomGuiFrame)e.getSource();
                    //tmp.resetSize();
                    
                }
        });
        
    }
    
    
    public void resetSize(){
        this.removeAll();
        GameRoomGui gui = new GameRoomGui(getSize());
        System.out.println("ventergrootte veranderd, nieuwe grootte: " + getSize().width + " " + getSize().height);
        this.add(gui);
        setContentPane(gui);
    }
    
    

};
